import HomePage from "@pages/home";
import LoginPage from '@pages/login'
import MainLayout from "@shared/mainLayout";
import Question from "@pages/question";
import Video from "@pages/video";
import Mine from "@pages/mine";
import Personal from "@pages/personal";
import Xxtz from "@pages/xxtz";
import Wdsc from "@pages/wdsc";
import Ydls from "@pages/ydls";
import Wdzp from "@pages/wdzp";
import Yhfk from "@pages/yhfk";
import Xztx from "@pages/xztx";

import { createBrowserRouter, RouterProvider } from "react-router-dom";
import NewPage from "@pages/question/NewPage";
import Search from "@pages/home/search";

export const router = createBrowserRouter([
  {
    path: "/",
    element: <MainLayout />,
    children: [
      { path: "", element: <HomePage /> },
      {
        path: "question",
        element: <Question />,
      },
      {
        path: "video",
        element: <Video />,
      },
      {
        path: "mine",
        element: <Mine />,
      },
    ],
  },
  {
    path: "/private",
    // element: <AuthRoute />,
    children: [
      {
        path: "personal",
        element: <Personal />,
      },
    ],
  },
  {
    path: "login",
    element: <LoginPage />,
  },
  {
    path: "xxtz",
    element: <Xxtz />,
  },
  {
    path: "wdsc",
    element: <Wdsc />,
  },
  {
    path: "ydls",
    element: <Ydls />,
  },
  {
    path: "wdzp",
    element: <Wdzp />,
  },
  {
    path: "yhfk",
    element: <Yhfk />,
  },
  {
    path: "xztx",
    element: <Xztx />,
  },
  {
    path: "newpage",
    element: <NewPage />,
  },
  {
    path: "search",
    element: <Search />,
  }
]);

export default function AppRouter() {
  return <RouterProvider router={router} />;
}